libxlu: handle NULL pointer in xlu_cfg_destroy
authorOlaf Hering <olaf@aepfle.de>
Thu, 7 May 2015 08:54:26 +0000 (08:54 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 8 May 2015 14:41:57 +0000 (15:41 +0100)
commit3c9fd195d25109368a2cd928c34fa15a7f785540
tree1a65413503b393fdc81f4ad8c20b41ccd315169d
parent00bfa383a4b051842d4853ed6c83d9adbd85dea4
libxlu: handle NULL pointer in xlu_cfg_destroy

Handle NULL pointer passed to xlu_cfg_destroy. libvirt calls it in its
libxlDriverConfigDispose function. If the XLU_Config was not initialized
yet for some reason a crash would occur on cleanup.
Avoid the crash just like libxl_ctx_free and xtl_logger_destroy do when
called from the same context.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxlu_cfg.c